package org.example.module_login.utlis;

import java.time.LocalDateTime;
import java.util.Random;

/**
 * 账号生成器
 *
 * @author HAJ
 * @since 2025-03-03 15:14:34
 */
public class CreateAccountNumber {

    public static String createAccountNumber(){
        // 获取当前日期和时间
        LocalDateTime now = LocalDateTime.now();
        // 获取年
        int year = now.getYear();
        // 获取月
        int month = now.getMonthValue();
        // 获取日
        int day = now.getDayOfMonth();
        // 获取时
        int hour = now.getHour();
        // 获取分
        int minute = now.getMinute();
        // 获取秒
        int second = now.getSecond();

        String accountNumber = year+""+month+day+hour+minute+second;

        Random random = new Random();
        int randomIntInRange = random.nextInt(10);

        return accountNumber+randomIntInRange;
    }

}
